/*
	This file is part of Floculate.
	Copyright (C) 2008  Bill Whitacre

	Floculate is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	Floculate is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef PROJECTION_H
#define PROJECTION_H

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <GL/gl.h>

#ifndef MATH_PI
#	ifndef M_PI
#		define MATH_PI 3.14159f
#	else
#		define MATH_PI M_PI
#	endif
#endif

typedef struct rat_projection
{
	int vpx,vpy,vpw,vph;
	float aspect,yfov,znear,zfar;
} rat_projection;

typedef struct rat_frustum
{
	int vpx,vpy,vpw,vph;
	float left,right,bottom,top,znear,zfar;
} rat_frustum;

void rat_build_frustum(rat_projection *proj,rat_frustum *frustum);
void rat_projection_push_frustum(rat_frustum *frustum);
void rat_projection_pop();

#endif

